<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    test
  </div>
  <script>
    let data = {
      msg: 'test'
    }
    let vm = {}
    Object.defineProperty(vm, 'msg', {
      enumerable: true,
      configurable: true,
      get() {
        return data.msg
      },
      set(val) {
        if (val === data.msg) {
          return
        }
        data.msg = val

        document.querySelector('#app').textContent = val
      }
    })
    
  </script>
</body>

</html>